<template>
  <div class="login-container">
    <h1 @click="formlogin">点击登陆</h1>
  </div>
</template>

<script>
export default {
  methods: {
    async formlogin() {
      let data = await this.$http.get('/api/login')
      if (data.data.code === 0) {
        sessionStorage.token = data.data.token
        console.log(this.$route, '路由信息')
        let fullPath = this.$route.query.fullPath;
        // window.location.href = '/admin'
        this.$router.push('/admin')
      }
    }
  },
}
</script>

<style>
</style>
